import request from '@/utils/request'
/**
 * @description 获取权限列表
 * @returns Promise
 */
export function getAllPermissionAPI() {
    return request({
        url:'/sys/permission',
        method:'GET'
    })
    
}
/**
 * @description 删除权限
 * @param {String} id
 * @returns Promise
 */
export function deletePermissionAPI(id) {
    return request({
        url:`/sys/permission/${id}`,
        method:'DELETE'
    })
    
}

/**
 * @description 删除权限
 * @param {String} id
 * @returns Promise
 */
export function getPermissionDetailAPI(id) {
    return request({
        url:`/sys/permission/${id}`,
        method:'GET'
    })
    
}
/**
 * @description 更新权限
 * @param {Object} data
 * @returns Promise
 */
export function updatePermissionAPI(data) {
    return request({
        url:`/sys/permission/${data.id}`,
        method:'PUT',
        data

    })
    
}
/**
 * @description 新增权限
 * @param {Object} data
 * @returns Promise
 */
export function createPermissionAPI(data) {
    return request({
        url:'/sys/permission',
        method:'POST',
        data

    })
    
}
